<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加萌娃 - <?php echo ($config["WEB_SITE_TITLE"]); ?></title>
    <script src="/Public/Home/js/adaptive.js"></script>
    <script src="/Public/Home/js/device.min.js"></script>
    <link rel="stylesheet" href="/Public/Home/css/reset.css">
    <link rel="stylesheet" href="/Public/Home/css/con-header.css">
    <script src="/Public/Home/js/mui.min.js"></script>
    <link href="/Public/Home/css/mui.min.css" rel="stylesheet"/>

    <style>
        h4,h5{margin-top: 0px;margin-bottom: 0px;}
        input::-webkit-input-placeholder,
        textarea::-webkit-input-placeholder {
            color: #9B9B9B;font-size: 0.3rem;
        }

        .content{width: 7.5rem;height: auto;margin: 0 auto;background: #fff;margin-top: 0.88rem;z-index: 10;padding-bottom: 1rem;}
        .top a{position: absolute;right: 0.3rem;bottom: 0.1rem;color: #fff;}
        .top{z-index: 100!important;}


        .xiugai{width: 100%;height: auto;padding: 0px 0.2rem;background: #fff}
        .xiugai li:first-child{height: 2rem;line-height: 2rem;}
        .xiugai li:first-child img{;float: right;width: 1.8rem;height: 1.8rem;border-radius: 50%;margin-top: 0.1rem;}
        .xiugai li{width: 100%;height: auto;border-bottom: 1px solid #DEDEDE;color: #4A4A4A;line-height: 0.9rem;position: relative;font-size: 0.32rem;}
        .xiugai li input{width: 5.5rem;height: 0.88rem;border: none;outline: none;position: absolute;left: 1.2rem;text-align: right;
            line-height: 0.9rem;text-indent:0px;}
        .xiugai li span{float: right}
        .xiugai li select{background: #DEDEDE;border-radius: 0.1rem;height: 0.7rem;width: 2rem;  float: right;margin-top: 0.1rem; margin-bottom: 0px; }

        .xiugai .diqu span{float: right;font-size: 0.3rem;color: #999}
        .xiugai .diqu span img{width: 0.2rem;height: 0.3rem;margin-left: 0.1rem;position: relative;top: 0.05rem;}


        .xiugai .sh span{width: 0.9rem;height: 0.6rem;border-radius: 0.1rem;background:#EEEEEE ;color: #333;text-align: center;line-height: 0.6rem;margin-top: 0.15rem;
        margin-left: 0.1rem;}



        /*下一步*/
        .next{width: 90%;height: 0.9rem;border-radius: 0.5rem;display: block;line-height: 0.9rem;
        ;text-align: center;background: #19B7BE;color: #fff;font-size: 0.32rem;margin-top: 1rem;}
    </style>
</head>
<body>


<div class="content">
    <div class="top">
        <h4>添加萌娃</h4>
        <img src="/Public/Home/img/tg-fanhui.png" class="back">
    </div>
<form action="" method="post">
    <ul class="xiugai">
        <li>头像 <img src="/Public/Home/img/banner1.png" alt="" id="tx2">
                <input type="file" name="head_pic" style="width: 100px;height: 100px;position: absolute;left: 295px;top: 5px;z-index: 99999;opacity: 0" onchange="sc(this.id)" id="txffl">
        </li>
        <li> 姓名 <input type="text" placeholder="请输入姓名" name="name">    </li>
        <li>体重 <input type="text" name="weight"><span>kg</span></li>
        <li>身高 <input type="text" name="height"><span>cm</span></li>
        <li>鞋码 <input type="text" name="shoose"><span>号</span></li>
        <li>生日 
            
            <select name="" id="sr3" style="width: 1.2rem;border: 1px solid #DEDEDE" onchange="getD(this.options[this.options.selectedIndex].value)">
                    <?php
 for($i=1;$i<=31;$i++){ echo "<option value='".$i."'>$i</option>"; } ?>
                
               
                </select>
                <select name="" id="sr1" style="width: 1.2rem;border: 1px solid #DEDEDE" onchange="getM(this.options[this.options.selectedIndex].value)">
                    <?php
 for($i=1;$i<=12;$i++){ echo "<option value='".$i."'>$i</option>"; } ?>
                
               
                </select> 
            <select name="" id="sr" style="width: 1.2rem;border: 1px solid #DEDEDE" onchange="getY(this.options[this.options.selectedIndex].value)">
                <?php
 $start=date("Y")-10; for($i=$start;$i<=date("Y");$i++){ echo "<option value='".$i."'>$i</option>"; } ?>
            
           
            </select>
        <li class="diqu">地区 <span>请选择地区 <img src="/Public/Home/img/back-right.png" alt=""></span></li>
        <li class="sex sh">性别
            <span onclick="changeS(2)">女</span>
            <span onclick="changeS(1)">男</span>
        </li>
        <li class="guoji sh">国籍
           <span onclick="changeC('中国')">中国</span>
           <span onclick="changeC('混血')">混血</span>
           <span onclick="changeC('外籍')">外籍</span>
        </li>
    </ul>

    <input type="hidden" name="head_pic" class="head_">
    <input type="hidden" name="birthday" class="birthday_">
    <input type="hidden" name="pro" class="pro_">
    <input type="hidden" name="city" class="city_">
    <input type="hidden" name="area" class="area_">
    <input type="hidden" name="sex" class="sex_">
    <input type="hidden" name="county" class="county_">

</form>
    <a href="javascript:;" class="juzhong next">提交</a>
</div>
<script src="/Public/Home/js/jquery-1.11.1.js"></script>
<script>
    var birY='';
    var birM='';
    var birD='';
    function getY(v){
            birY=v;
    }
    function getM(v){
            birM=v;
    }
    function getD(v){
            birD=v;
    }


    function changeC(v){
        $(".county_").val(v);
    }
    function changeS(v){
        $(".sex_").val(v)
    }
    $(".next").click(function(){
            var birthday=birY+"-"+birM+"-"+birD;
            $(".birthday_").val(birthday)
            $("form").submit()
    })



    $(".back").click(function () {
        window.history.back(-1);
    })
$(".sh span").click(function () {
    $(this).css({"background":" #01B0B8","color":"#fff"}).siblings().css({"background":" #EEEEEE","color":"#333"})
})



</script>

<script>
    function sc(id){  

            var fileObj = document.getElementById(id).files[0]; // 获取文件对象
            var FileController = "<?php echo U('User/upfile');?>";                    // 接收上传文件的后台地址 
            // FormData 对象
            var form = new FormData();
            form.append("author", "竹叶科技");  
            form.append("id",id);                       // 可以增加表单数据
            form.append(id, fileObj);                           // 文件对象
            // XMLHttpRequest 对象
            var xhr = new XMLHttpRequest();
            xhr.open("post", FileController, true);
            xhr.onload = function () {
              
              var posit=this.responseText;
              //console.log(posit);
              document.getElementById('tx2').src=posit;
              $(".head_").val(posit)
            };
            xhr.send(form);
            /*alert("上传完成")*/
    
    } 
</script>
</body>
</html>